/*
 * BorderLayout组件
 */
package awt;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JFrame;

public class Demo2 extends JFrame {
	JButton jb1, jb2, jb3, jb4, jb5;

	public Demo2() {

		jb1 = new JButton("中部");
		jb2 = new JButton("东部");
		jb3 = new JButton("西部");
		jb4 = new JButton("南部");
		jb5 = new JButton("北部");
		this.add(jb1, BorderLayout.CENTER);
		// this.add(jb2, BorderLayout.EAST);
		this.add(jb3, BorderLayout.WEST);
		this.add(jb4, BorderLayout.SOUTH);
		// this.add(jb5, BorderLayout.NORTH);
		this.setTitle("边界布局");
		this.setSize(200, 300);
		this.setLocation(100, 200);
		this.setVisible(true);
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

	public static void main(String[] args) {
		Demo2 demo2 = new Demo2();

	}

}
